<template>
	<view>
		<uni-nav-bar fixed left-icon="back" title="发票中心"></uni-nav-bar>

		<view class="un-row" v-for="(item, index) in list" :key="index">
			<view class="tui-flex pad-bod">
				<view class="flex-img">
					<img :src="item.img" width="100%" height="100%" alt="">
				</view>
				<view class="flex-center">
					<view class="cen-title">{{item.title}}</view>
					<view class="cen-txt">订单编号: {{item.order}}</view>
					<view class="cen-txt">开票金额: ￥{{item.money}}</view>
				</view>
			</view>
			<view class="tui-flex pad">
				<view class="flex-let">
					<view>申请时间: {{item.createTime}}</view>
					<view v-if="item.invoiceTime">开票时间: {{item.invoiceTime}}</view>
				</view>
				<view class="flex-right">
					<view v-if="item.status == 1">
						<text>待出票</text>
					</view>
					<view v-else>
						<button plain class="btn" size="mini" @tap="invoTo">查看发票</button>
					</view>
				</view>
			</view>
		</view>

		<!--<view style="margin: 30rpx">-->
			<!--<img :src="SRC" width="100%" height="100%" alt="">-->
		<!--</view>-->

	</view>
</template>
<script>
	export default {
		data() {
			return {
                SRC: '',
				list: [
					{
						title: '农业科技馆',
						img: 'http://p5.itc.cn/images01/20201021/8ef11b4f523348d89a1be4295c9e70a8.png',
						order: 374820849032,
						money: 520.0,
						createTime: '2020.05.24 13:12:23',
                        invoiceTime: '',
                        status: 1
					},
                    {
                        title: '农业科技馆',
                        img: 'http://p5.itc.cn/images01/20201021/8ef11b4f523348d89a1be4295c9e70a8.png',
                        order: 374820849032,
                        money: 520.0,
                        createTime: '2020.05.24 13:12:23',
                        invoiceTime: '2020.05.24 14:14:09',
                        status: 0
                    }
				]
			}
		},
		onLoad() {
            this.getList()
		},
		methods: {
			getList() {
				this.$api.api('order.receipt').then(res => {
				}).catch(error => {
				})
			},
            invoTo() {
                uni.showToast({title: '功能暂未开发', icon: 'none'})
            }
		}
	}
</script>
<style lang="scss" scoped>
.un-row {
	margin: 40rpx 30rpx;
	background: #fff;
	border-radius: 15rpx;
	padding: 30rpx;
	.pad-bod {
		padding-bottom: 20rpx;
		border-bottom: 2rpx solid #eee;
	}
	.flex-img {
		width: 25%;
		height: 140rpx;
	}
	.flex-center {
		flex: 1;
		padding-left: 30rpx;
		.cen-title {
			font-weight: 500;
			font-size: 38rpx;
		}
		.cen-txt {
			color: #999;
		}
	}
	.pad {
		padding: 20rpx 0 0;
		.flex-let {
			flex: 1;
			color: #ccc;
		}
		.flex-right {
			width: 33%;
			color: #6CB041;
			text-align: right;
			.btn {
				background: #fff;
				border-radius: 40rpx;
				color: #6CB041;
				border: 2rpx solid #6CB041;
			}
		}
	}
}
</style>